//
//  AZPeripheralCell.m
//  AZBLE
//
//  Created by AZ-Mac on 2017/4/28.
//  Copyright © 2017年 AZ-Mac. All rights reserved.
//

#import "AZPeripheralCell.h"
#import "AZPeripheralModel.h"
@interface AZPeripheralCell()

@property (weak, nonatomic) IBOutlet UILabel *servicesCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *peripheralNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *RSSILabel;
@end
@implementation AZPeripheralCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setPeripheralModel:(AZPeripheralModel *)peripheralModel
{
    _peripheralModel = peripheralModel;
    if(peripheralModel.peripheral.name == nil)
    {
        self.peripheralNameLabel.text = @"未命名蓝牙";
    }
    else
    {
        self.peripheralNameLabel.text = peripheralModel.peripheral.name;
    }
    self.RSSILabel.text = [NSString stringWithFormat:@"RSSI:%@",peripheralModel.RSSI];
    self.servicesCountLabel.text = [NSString stringWithFormat:@"发现%d个服务",peripheralModel.peripheral.services.count];
}
- (void)setFrame:(CGRect)frame{
    
    CGRect oriF = frame;
    frame.origin.y-= 8;
    [super setFrame:oriF];
    
}

@end
